package com.atguigu.exer5_2;

//（3）声明另一个Employee类型，有属性：姓名name（String类型），生日birthday（MyDate类型）
public class Employee {//员工
    private String name;
    private MyDate birthday;

    //构造器，快捷键Alt  + Insert
    public Employee() {
    }
    public Employee(String name, MyDate birthday) {
        this.name = name;
        this.birthday = birthday;
    }
    //手写，单独定制
    public Employee(String name, int year, int month, int day){
        this.name = name;
        birthday = new MyDate(year, month, day);//=右边用的是MyDate类的构造器，意味着MyDate类须有一个全参构造
    }

    //get/set,快捷键Alt  + Insert
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MyDate getBirthday() {
        return birthday;
    }

    public void setBirthday(MyDate birthday) {
        this.birthday = birthday;
    }

    public String getInfo(){
        return "姓名：" + name +"，生日：" + birthday.getInfo();
    }
}
